import request from '@/utils/request'
export function listUnit(query){
    return request({
        url: '/product/productUnit/list',
        method: 'get',
        params: query
    })
}

export function listAllUnit(){
    return request({
        url: '/product/productUnit/getUnitAll',
        method: 'get'
    })
}

export function deleteUnit (id){
    return request({
        url: '/product/productUnit/' + id,
        method: 'delete'
    })
}

export function addUnit(data){
    return request({
        url: '/product/productUnit',
        method: 'post',
        data: data
    })
}

export function getUnit(id){
    return request({
        url: '/product/productUnit/' + id,
        method: 'get'
    })
}

export function updateUnit(data){
    return request({
        url: '/product/productUnit',
        method: 'put',
        data: data
    })
}